<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>tival</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="timout.html" title="timout" />
    <link rel="next" href="tlineto.html" title="tlineto" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">tival</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="timout.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="tlineto.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="tival"></a>
      <div class="titlepage"></div>
      <a id="IndexTival" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">tival</span>
        </h2>
        <p>tival — 
       Puts the value of the instrument's internal <span class="quote">“<span class="quote">tie-in</span>”</span> flag into the named i-rate variable.
           </p>
      </div>
      <div class="refsect1">
        <a id="idp158598256"></a>
        <h2>Syntax</h2>
        <pre class="synopsis">ir <span class="command"><strong>tival</strong></span></pre>
      </div>
      <div class="refsect1">
        <a id="idp158666320"></a>
        <h2>Description</h2>
        <p> 
      Puts the value of the instrument's internal <span class="quote">“<span class="quote">tie-in</span>”</span> flag into the named i-rate variable.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp158668048"></a>
        <h2>Initialization</h2>
        <p>
      Puts the value of the instrument's internal <span class="quote">“<span class="quote">tie-in</span>”</span> flag into the named i-rate variable. Assigns 1 if this note has been <span class="quote">“<span class="quote">tied</span>”</span> onto a previously held note (see <a class="link" href="i.html" title="i Statement (Instrument or Note Statement)"><em class="citetitle">i statement</em></a>); assigns 0 if no tie actually took place. (See also <a class="link" href="tigoto.html" title="tigoto"><em class="citetitle">tigoto</em></a>.)
    </p>
      </div>
      <div class="refsect1">
        <a id="idp158672048"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the tival opcode. It uses the file <a class="ulink" href="examples/tival.csd" target="_top"><em class="citetitle">tival.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp158673904"></a>
          <p class="title">
            <strong>Example 932. Example of the tival opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac   <span class="comment">;;;realtime audio out</span>
<span class="comment">;-iadc    ;;;uncomment -iadc if realtime audio input is needed too</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; -o tival.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span> <span class="op">=</span> 44100 
<span class="ohdr">ksmps</span> <span class="op">=</span> 32 
<span class="ohdr">nchnls</span> <span class="op">=</span> 2
<span class="ohdr">0dbfs</span>  <span class="op">=</span> 1 

<span class="oblock">instr</span> 1

idur  <span class="op">=</span> <span class="opc">abs</span>(p3)				<span class="comment">;make p3 positive even if p3 is negative in score</span>
itiv  <span class="opc">tival</span>
i1    <span class="op">=</span> <span class="op">-</span>1				<span class="comment">;assume this is tied note, so keep fase of oscili</span>
      <span class="octrl">tigoto</span> <span class="olabel">slur</span>			<span class="comment">;no reinitialisation on tied notes</span>
i1    <span class="op">=</span> 0				<span class="comment">;first note, so reset phase</span>
aatt  <span class="opc">line</span> p4, idur, 0			<span class="comment">;primary envelope</span>

<span class="olabel">slur</span><span class="op">:</span>
      <span class="octrl">if</span> itiv<span class="op">==</span>0 <span class="octrl">kgoto</span> <span class="olabel">note</span>		<span class="comment">;no expression on first and second note</span>
aslur <span class="opc">linseg</span> 0, idur<span class="op">*</span>.3, p4, idur<span class="op">*</span>.7, 0	<span class="comment">;envelope for slurred note</span>
aatt  <span class="op">=</span> aatt <span class="op">+</span> aslur

<span class="olabel">note</span><span class="op">:</span>
asig  <span class="opc">oscili</span> aatt, p5, 1, i1
      <span class="opc">outs</span>   asig, asig

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>
<span class="stamnt">f</span>1 0 4096 10 1	<span class="comment">;sine wave</span>

<span class="stamnt">i</span>1  0    -5  .8  451	<span class="comment">;p3 = 5 seconds</span>
<span class="stamnt">i</span>1  1.5 -1.5 .1  512 
<span class="stamnt">i</span>1  3    2   .7  440	<span class="comment">;3 notes together--&gt; duration = 5 seconds</span>
                    
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp158678192"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="assign.html" title="="><em class="citetitle">=</em></a>,
      <a class="link" href="divz.html" title="divz"><em class="citetitle">divz</em></a>,
      <a class="link" href="init.html" title="init"><em class="citetitle">init</em></a>
      </p>
        <p> More on this opcode: <a class="ulink" href="http://www.csoundjournal.com/2005fall/tiedNotes.html" target="_top"><em class="citetitle">http://www.csoundjournal.com/2005fall/tiedNotes.html</em></a>  , written by Steven Yi </p>
        <p> 
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="timout.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="tlineto.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">timout </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> tlineto</td>
        </tr>
      </table>
    </div>
  </body>
</html>
